package com.zkingsoft.newdao;

import java.sql.Connection;
import java.sql.PreparedStatement;

import com.zkingsoft.model.Dictionary;
import com.zkingsoft.plugin.util.DBUtil;

public class PdkUserDao {

	public int updateDiamondById(int id,int diamondNum,Connection conn)throws Exception{
		String sql = "UPDATE userdata SET diamondnum =? WHERE userid=?";
		PreparedStatement ps = conn.prepareStatement(sql);
		ps.setInt(1, diamondNum);
		ps.setInt(2, id);
		int result = ps.executeUpdate();
		if(result>0){
			return 1;
		}
		return 0;
	}
}
